Returns  True in a layout procedure and a script when a process is made active. That is when the window containing the layout or script becomes the frontmost window of the frontmost process. For a script the Activated phase is executed only.
You should not place the  TRACE or  ALERT commands in the activated phase of the layout or script because this will cause an endless loop. If you want the Activated phase of a script to be called make sure that the Script Only If Modified checkbox is unchecked.
The following example describes how to create a floating window that contains buttons for basic record actions such as Add, Modify, Delete, and Print. The floating window also displays the name of the file. We use the command CALL PROCESS to update the name of the file in the floating window each time the order of the windows is changed. Instead of repeating the following code in the layout report of each window, it is better to call a global procedure that contains:
Case of
:(Deactivated)
◊Action:=0
CALL PROCESS(◊Dashboard)
:(Activated)
◊Action:=1
◊Fileshown:=»[Customers]
CALL PROCESS(◊Dashboard)
:(Outside Call)
Case of
....
:(◊Action=2)
PRINT SELECTION([Customers])
End case
End case
The layout report procedure of the floating window is:
Case of
:(Before)
`....
:(Outside Call)
Case of
:(◊Action=0) ` Window has been deactivated
vFileName:="No file selected"
DISABLE BUTTON(bPrint)
` Here we manage the other buttons.
:(◊Action=1)
vFileName:=Filename(◊FileShown)
 If (Records in selection(◊FileShown»)>0)
ENABLE BUTTON(bPrint)
Else
DISABLE BUTTON(bPrint)
End If
Else
`.......
End case
:(During)
Case of
:(bPrint=1)
◊Action:=2
CALL PROCESS(Frontmost process(*))
End case
End case
Note the use of the interprocess variables ◊Action and ◊File and the CALL PROCESS command to create a messaging system between the different windows.